Integrand size = 20, antiderivative size = 157 \[ \int \frac {(c+d x)^2}{a+b \tanh (e+f x)} \, dx=\frac {(c+d x)^3}{3 (a+b) d}-\frac {b (c+d x)^2 \log \left (1+\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac {b d (c+d x) \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f^2}+\frac {b d^2 \operatorname {PolyLog}\left (3,-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 \left (a^2-b^2\right ) f^3} \]
[Out]
Time = 0.21 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3813, 2221, 2611, 2320, 6724} \[ \int \frac {(c+d x)^2}{a+b \tanh (e+f x)} \, dx=\frac {b d (c+d x) \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{f^2 \left (a^2-b^2\right )}-\frac {b (c+d x)^2 \log \left (\frac {(a-b) e^{-2 (e+f x)}}{a+b}+1\right )}{f \left (a^2-b^2\right )}+\frac {b d^2 \operatorname {PolyLog}\left (3,-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 f^3 \left (a^2-b^2\right )}+\frac {(c+d x)^3}{3 d (a+b)} \]
[In]
[Out]
Rule 2221
Rule 2320
Rule 2611
Rule 3813
Rule 6724
Rubi steps \begin{align*} \text {integral}& = \frac {(c+d x)^3}{3 (a+b) d}+(2 b) \int \frac {e^{-2 (e+f x)} (c+d x)^2}{(a+b)^2+\left (a^2-b^2\right ) e^{-2 (e+f x)}} \, dx \\ & = \frac {(c+d x)^3}{3 (a+b) d}-\frac {b (c+d x)^2 \log \left (1+\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac {(2 b d) \int (c+d x) \log \left (1+\frac {\left (a^2-b^2\right ) e^{-2 (e+f x)}}{(a+b)^2}\right ) \, dx}{\left (a^2-b^2\right ) f} \\ & = \frac {(c+d x)^3}{3 (a+b) d}-\frac {b (c+d x)^2 \log \left (1+\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac {b d (c+d x) \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f^2}-\frac {\left (b d^2\right ) \int \operatorname {PolyLog}\left (2,-\frac {\left (a^2-b^2\right ) e^{-2 (e+f x)}}{(a+b)^2}\right ) \, dx}{\left (a^2-b^2\right ) f^2} \\ & = \frac {(c+d x)^3}{3 (a+b) d}-\frac {b (c+d x)^2 \log \left (1+\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac {b d (c+d x) \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f^2}+\frac {\left (b d^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}\left (2,\frac {(-a+b) x}{a+b}\right )}{x} \, dx,x,e^{-2 (e+f x)}\right )}{2 \left (a^2-b^2\right ) f^3} \\ & = \frac {(c+d x)^3}{3 (a+b) d}-\frac {b (c+d x)^2 \log \left (1+\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac {b d (c+d x) \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f^2}+\frac {b d^2 \operatorname {PolyLog}\left (3,-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 \left (a^2-b^2\right ) f^3} \\ \end{align*}
Time = 0.65 (sec) , antiderivative size = 200, normalized size of antiderivative = 1.27 \[ \int \frac {(c+d x)^2}{a+b \tanh (e+f x)} \, dx=\frac {1}{6} \left (-\frac {4 b (c+d x)^3}{(a+b) d \left (b \left (-1+e^{2 e}\right )+a \left (1+e^{2 e}\right )\right )}-\frac {6 b (c+d x)^2 \log \left (1+\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{(a-b) (a+b) f}+\frac {3 b d \left (2 f (c+d x) \operatorname {PolyLog}\left (2,\frac {(-a+b) e^{-2 (e+f x)}}{a+b}\right )+d \operatorname {PolyLog}\left (3,\frac {(-a+b) e^{-2 (e+f x)}}{a+b}\right )\right )}{(a-b) (a+b) f^3}+\frac {2 x \left (3 c^2+3 c d x+d^2 x^2\right ) \cosh (e)}{a \cosh (e)+b \sinh (e)}\right ) \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(732\) vs. \(2(157)=314\).
Time = 0.34 (sec) , antiderivative size = 733, normalized size of antiderivative = 4.67
method | result | size |
risch | \(\frac {d^{2} x^{3}}{3 a +3 b}+\frac {d c \,x^{2}}{a +b}+\frac {c^{2} x}{a +b}+\frac {c^{3}}{3 \left (a +b \right ) d}+\frac {2 b \,d^{2} e^{2} \ln \left ({\mathrm e}^{f x +e}\right )}{f^{3} \left (a +b \right ) \left (a -b \right )}-\frac {b \,d^{2} e^{2} \ln \left ({\mathrm e}^{2 f x +2 e} a +b \,{\mathrm e}^{2 f x +2 e}+a -b \right )}{f^{3} \left (a +b \right ) \left (a -b \right )}+\frac {2 b \,d^{2} e^{2} x}{f^{2} \left (a +b \right ) \left (-a +b \right )}-\frac {b \,d^{2} \ln \left (1-\frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{-a +b}\right ) e^{2}}{f^{3} \left (a +b \right ) \left (-a +b \right )}+\frac {b \,d^{2} \operatorname {polylog}\left (2, \frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{-a +b}\right ) x}{f^{2} \left (a +b \right ) \left (-a +b \right )}-\frac {2 b d c \,x^{2}}{\left (a +b \right ) \left (-a +b \right )}-\frac {2 b d c \,e^{2}}{f^{2} \left (a +b \right ) \left (-a +b \right )}+\frac {2 b d c \ln \left (1-\frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{-a +b}\right ) x}{f \left (a +b \right ) \left (-a +b \right )}+\frac {b d c \operatorname {polylog}\left (2, \frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{-a +b}\right )}{f^{2} \left (a +b \right ) \left (-a +b \right )}-\frac {4 b d c e x}{f \left (a +b \right ) \left (-a +b \right )}+\frac {2 b d c \ln \left (1-\frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{-a +b}\right ) e}{f^{2} \left (a +b \right ) \left (-a +b \right )}-\frac {b \,c^{2} \ln \left ({\mathrm e}^{2 f x +2 e} a +b \,{\mathrm e}^{2 f x +2 e}+a -b \right )}{f \left (a +b \right ) \left (a -b \right )}+\frac {2 b \,c^{2} \ln \left ({\mathrm e}^{f x +e}\right )}{f \left (a +b \right ) \left (a -b \right )}-\frac {2 b \,d^{2} x^{3}}{3 \left (a +b \right ) \left (-a +b \right )}+\frac {4 b \,d^{2} e^{3}}{3 f^{3} \left (a +b \right ) \left (-a +b \right )}+\frac {b \,d^{2} \ln \left (1-\frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{-a +b}\right ) x^{2}}{f \left (a +b \right ) \left (-a +b \right )}-\frac {b \,d^{2} \operatorname {polylog}\left (3, \frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{-a +b}\right )}{2 f^{3} \left (a +b \right ) \left (-a +b \right )}-\frac {4 b d c e \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2} \left (a +b \right ) \left (a -b \right )}+\frac {2 b d c e \ln \left ({\mathrm e}^{2 f x +2 e} a +b \,{\mathrm e}^{2 f x +2 e}+a -b \right )}{f^{2} \left (a +b \right ) \left (a -b \right )}\) | \(733\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 500 vs. \(2 (152) = 304\).
Time = 0.27 (sec) , antiderivative size = 500, normalized size of antiderivative = 3.18 \[ \int \frac {(c+d x)^2}{a+b \tanh (e+f x)} \, dx=\frac {{\left (a + b\right )} d^{2} f^{3} x^{3} + 3 \, {\left (a + b\right )} c d f^{3} x^{2} + 3 \, {\left (a + b\right )} c^{2} f^{3} x + 6 \, b d^{2} {\rm polylog}\left (3, \sqrt {-\frac {a + b}{a - b}} {\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )}\right ) + 6 \, b d^{2} {\rm polylog}\left (3, -\sqrt {-\frac {a + b}{a - b}} {\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )}\right ) - 6 \, {\left (b d^{2} f x + b c d f\right )} {\rm Li}_2\left (\sqrt {-\frac {a + b}{a - b}} {\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )}\right ) - 6 \, {\left (b d^{2} f x + b c d f\right )} {\rm Li}_2\left (-\sqrt {-\frac {a + b}{a - b}} {\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )}\right ) - 3 \, {\left (b d^{2} e^{2} - 2 \, b c d e f + b c^{2} f^{2}\right )} \log \left (2 \, {\left (a + b\right )} \cosh \left (f x + e\right ) + 2 \, {\left (a + b\right )} \sinh \left (f x + e\right ) + 2 \, {\left (a - b\right )} \sqrt {-\frac {a + b}{a - b}}\right ) - 3 \, {\left (b d^{2} e^{2} - 2 \, b c d e f + b c^{2} f^{2}\right )} \log \left (2 \, {\left (a + b\right )} \cosh \left (f x + e\right ) + 2 \, {\left (a + b\right )} \sinh \left (f x + e\right ) - 2 \, {\left (a - b\right )} \sqrt {-\frac {a + b}{a - b}}\right ) - 3 \, {\left (b d^{2} f^{2} x^{2} + 2 \, b c d f^{2} x - b d^{2} e^{2} + 2 \, b c d e f\right )} \log \left (\sqrt {-\frac {a + b}{a - b}} {\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )} + 1\right ) - 3 \, {\left (b d^{2} f^{2} x^{2} + 2 \, b c d f^{2} x - b d^{2} e^{2} + 2 \, b c d e f\right )} \log \left (-\sqrt {-\frac {a + b}{a - b}} {\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )} + 1\right )}{3 \, {\left (a^{2} - b^{2}\right )} f^{3}} \]
[In]
[Out]
\[ \int \frac {(c+d x)^2}{a+b \tanh (e+f x)} \, dx=\int \frac {\left (c + d x\right )^{2}}{a + b \tanh {\left (e + f x \right )}}\, dx \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 337 vs. \(2 (152) = 304\).
Time = 0.31 (sec) , antiderivative size = 337, normalized size of antiderivative = 2.15 \[ \int \frac {(c+d x)^2}{a+b \tanh (e+f x)} \, dx=-\frac {{\left (2 \, f x \log \left (\frac {{\left (a e^{\left (2 \, e\right )} + b e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{a - b} + 1\right ) + {\rm Li}_2\left (-\frac {{\left (a e^{\left (2 \, e\right )} + b e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{a - b}\right )\right )} b c d}{a^{2} f^{2} - b^{2} f^{2}} - \frac {{\left (2 \, f^{2} x^{2} \log \left (\frac {{\left (a e^{\left (2 \, e\right )} + b e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{a - b} + 1\right ) + 2 \, f x {\rm Li}_2\left (-\frac {{\left (a e^{\left (2 \, e\right )} + b e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{a - b}\right ) - {\rm Li}_{3}(-\frac {{\left (a e^{\left (2 \, e\right )} + b e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{a - b})\right )} b d^{2}}{2 \, {\left (a^{2} f^{3} - b^{2} f^{3}\right )}} - c^{2} {\left (\frac {b \log \left (-{\left (a - b\right )} e^{\left (-2 \, f x - 2 \, e\right )} - a - b\right )}{{\left (a^{2} - b^{2}\right )} f} - \frac {f x + e}{{\left (a + b\right )} f}\right )} + \frac {2 \, {\left (b d^{2} f^{3} x^{3} + 3 \, b c d f^{3} x^{2}\right )}}{3 \, {\left (a^{2} f^{3} - b^{2} f^{3}\right )}} + \frac {d^{2} x^{3} + 3 \, c d x^{2}}{3 \, {\left (a + b\right )}} \]
[In]
[Out]
\[ \int \frac {(c+d x)^2}{a+b \tanh (e+f x)} \, dx=\int { \frac {{\left (d x + c\right )}^{2}}{b \tanh \left (f x + e\right ) + a} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(c+d x)^2}{a+b \tanh (e+f x)} \, dx=\int \frac {{\left (c+d\,x\right )}^2}{a+b\,\mathrm {tanh}\left (e+f\,x\right )} \,d x \]
[In]
[Out]